package com.dpp.dbase.config;

import java.util.HashMap;
import java.util.Map;

/**
 * 图层样式配置类
 */
public class LayerStyleConfig {
    private String layerName;
    private String styleField; // 用于样式化的字段名
    private Map<String, SymbolConfig> valueSymbols; // 字段值对应的符号配置
    private SymbolConfig defaultSymbol; // 默认符号配置

    public LayerStyleConfig(String layerName) {
        this.layerName = layerName;
        this.valueSymbols = new HashMap<>();
    }

    // Getters and Setters
    public String getLayerName() { return layerName; }
    public void setLayerName(String layerName) { this.layerName = layerName; }

    public String getStyleField() { return styleField; }
    public void setStyleField(String styleField) { this.styleField = styleField; }

    public Map<String, SymbolConfig> getValueSymbols() { return valueSymbols; }
    public void setValueSymbols(Map<String, SymbolConfig> valueSymbols) { this.valueSymbols = valueSymbols; }

    public SymbolConfig getDefaultSymbol() { return defaultSymbol; }
    public void setDefaultSymbol(SymbolConfig defaultSymbol) { this.defaultSymbol = defaultSymbol; }

    /**
     * 添加字段值对应的符号配置
     */
    public void addValueSymbol(String fieldValue, SymbolConfig symbolConfig) {
        this.valueSymbols.put(fieldValue, symbolConfig);
    }
}
